package org.test.cloud.producer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication
@EnableDiscoveryClient
@EnableAutoConfiguration
public class ApplicationMain  {
    
    private static String[] properties = {"spring.config.name:application", "spring.config.location:classpath*:/"};
    public static void main(final String []args){
        SpringApplication.run(ApplicationMain.class,args);
    }
   /* public static void main(String[] args) {
        Integer SERVER_PORT = 8080;
        String[] args0 = new String[args.length + 1];
        if (args != null && args.length > 0) {
            SERVER_PORT = Integer.valueOf(args[0]);
            System.arraycopy(args, 0, args0, 0, args.length);
            args0[args.length] = "--server.port=" + SERVER_PORT;
        }
        else {
            args0 = args;
        }
        new SpringApplicationBuilder(ApplicationMain.class).properties(properties).build().run(args0);
    }*/
    
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ApplicationMain.class).properties(properties);
    }
    
   /* @Override
    public void run(String [] args)
        throws Exception {
    }*/
    
}
